import { initRouter, initRouterLayout } from '@hsui/core'

export default initRouter(
  [
    {
      path: '/',
      component: initRouterLayout((layout) => {
        return import('@/layouts/' + layout + '.vue')
      }),
      children: [
        {
          name: 'index',
          path: '',
          component: Index,
          children: [
            {
              name: 'index-home',
              path: 'home',
              component: IndexHome,
            },
          ],
        },
        {
          name: 'bank-recharge',
          path: 'bank/recharge',
          component: BankRecharge,
        },
        {
          name: 'liquidation-liquidation',
          path: 'liquidation/liquidation',
          component: LiquidationLiquidation,
        },
        {
          name: 'order-order',
          path: 'order/order',
          component: OrderOrder,
        },
        {
          name: 'product-info',
          path: 'product/info',
          component: ProductInfo,
        },
        {
          name: 'product-TrendChart',
          path: 'product/TrendChart',
          component: ProductTrendChart,
        },
        {
          name: 'trade-redeem',
          path: 'trade/redeem',
          component: TradeRedeem,
        },
        {
          name: 'trade-subscribe',
          path: 'trade/subscribe',
          component: TradeSubscribe,
        },
        {
          name: 'user-info',
          path: 'user/info',
          component: UserInfo,
        },
        {
          name: 'user-register',
          path: 'user/register',
          component: UserRegister,
        },
        {
          name: '__404__',
          path: '*',
          component: __404__,
        },
      ],
    },
  ],
  { base: '/', mode: 'hash' }
)

function Index() {
  return import(/* webpackChunkName: "index" */ '@/views/index.vue')
}
function IndexHome() {
  return import(/* webpackChunkName: "index-home" */ '@/views/index/home.vue')
}
function BankRecharge() {
  return import(
    /* webpackChunkName: "bank-recharge" */ '@/views/bank/recharge.vue'
  )
}
function LiquidationLiquidation() {
  return import(
    /* webpackChunkName: "liquidation-liquidation" */ '@/views/liquidation/liquidation.vue'
  )
}
function OrderOrder() {
  return import(/* webpackChunkName: "order-order" */ '@/views/order/order.vue')
}
function ProductInfo() {
  return import(
    /* webpackChunkName: "product-info" */ '@/views/product/info.vue'
  )
}
function ProductTrendChart() {
  return import(
    /* webpackChunkName: "product-TrendChart" */ '@/views/product/TrendChart.vue'
  )
}
function TradeRedeem() {
  return import(
    /* webpackChunkName: "trade-redeem" */ '@/views/trade/redeem.vue'
  )
}
function TradeSubscribe() {
  return import(
    /* webpackChunkName: "trade-subscribe" */ '@/views/trade/subscribe.vue'
  )
}
function UserInfo() {
  return import(/* webpackChunkName: "user-info" */ '@/views/user/info.vue')
}
function UserRegister() {
  return import(
    /* webpackChunkName: "user-register" */ '@/views/user/register.vue'
  )
}
function __404__() {
  return import(/* webpackChunkName: "__404__" */ '@/views/__404__.vue')
}
